<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body{
            background: #CDCBCD;
        }
        .small-icon img{
            width:116px;
        }
        .current{
            border:1px solid #00B5E5;
        }
    </style>
</head>
<body>
    <div>
        <h1>美女画廊</h1>
        <div class="small-icon">
            <img src="images/01.png" alt="" class="current">
            <img src="images/02.png" alt="">
            <img src="images/03.png" alt="">
            <img src="images/04.png" alt="">
            <img src="images/05.png" alt="">
        </div>
        <div class="content">
            <img src="images/01.png" alt="" class="current" >
        </div>
    </div>
    <script>
        var tabs = document.querySelectorAll(".small-icon>img");
        var show = document.querySelectorAll(".content>img")[0];
        for(let i=0;i<tabs.length;i++){
            tabs[i].index = i;
            tabs[i].onclick = function(){
                for(let i=0;i<tabs.length;i++){
                    tabs[i].classList.remove("current")
                }
                this.classList.add("current")
                var currentIndex = this.index;
                show.src = `images/0${currentIndex+1}.png`
            }
        }
    </script>
</body>
</html>